<template>
  <div class="link">
    <p>id:{{ query.id }}</p>
    <p>news:{{ query.news }}</p>
    <p v-if="query.content">content:{{ query.content }}</p>
    <p v-else>content:开心每一天</p>
  </div>
</template>

<script setup lang="ts" name="link">
import { useRoute } from "vue-router";
import { toRefs } from "vue";
// 没有路由props接收方式
const route = useRoute();
const { query } = toRefs(route);

//使用路由props接收
// defineProps(['id', 'news', 'content'])
</script>

<style scoped lang="scss"></style>
